Socket
Socket
Sign inDemoInstall

micromark-util-encode

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-util-encode

micromark utility to encode dangerous html characters


Version published
Weekly downloads
6.3M
increased by7.89%
Maintainers
1
Weekly downloads
 
Created

What is micromark-util-encode?

The micromark-util-encode package is a utility library for encoding HTML entities in text. It is part of the micromark ecosystem, which is a markdown parser compliant with CommonMark. This utility is specifically designed to help with the encoding of characters that have special meaning in HTML, ensuring that text is safely and correctly displayed in an HTML context.

What are micromark-util-encode's main functionalities?

HTML Entity Encoding

This feature allows for the encoding of text containing characters that have special meaning in HTML, such as '<', '>', and '&', into their corresponding HTML entities. This is useful for displaying user-generated content without risking HTML injection vulnerabilities.

"use strict";

var encode = require('micromark-util-encode');

var result = encode('<div>Hello & Welcome</div>');
console.log(result); // Outputs: '&lt;div&gt;Hello &amp; Welcome&lt;/div&gt;'

Other packages similar to micromark-util-encode

Keywords

FAQs

Package last updated on 21 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc